package com.jinxin.platform.cdsmsmgr.controller;

import com.jinxin.platform.base.api.annotation.APCOSApi;
import com.jinxin.platform.base.api.annotation.APCOSApiOperation;
import com.jinxin.platform.base.api.constant.APCOSApiConstans;
import com.jinxin.platform.cdsmsmgr.pojo.domains.SmsAkInfo;
import com.jinxin.platform.cdsmsmgr.pojo.entity.ResultEntity;
import com.jinxin.platform.cdsmsmgr.service.ISmsAkInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * All rights Reserved, Designed By www.beonelot.com
 *
 * @version: V1.0
 * @Copyright: www.beonelot.com Inc. All rights reserved.
 * @Description：
 * @Date: 2020-06-17
 * @Author: Lingnan
 **/
@APCOSApi(value = "账号配置接口", developers = {"那个男人"}, description = "账号配置接口")
@RestController
@RequestMapping("/cdsmsmgr/smsAkInfo")
@Slf4j
public class SmsAkInfoController {
    @Autowired
    private ISmsAkInfoService smsAkInfoService;

    @APCOSApiOperation(value = "获取当前人员的短信账号信息", developers = {"lingnan"}, description = "获取当前人员的短信账号信息",
            infType = APCOSApiConstans.INF_TYPE_OTHER, infCategory = APCOSApiConstans.INF_CATEGORY_WEB)
    @GetMapping("/getAkInfoByUser")
    public ResultEntity getAkInfoByUser(){
        return smsAkInfoService.getAkInfoByUser();
    }

    @APCOSApiOperation(value = "保存或更新短信账号信息", developers = {"lingnan"}, description = "保存或更新短信账号信息",
            infType = APCOSApiConstans.INF_TYPE_OTHER, infCategory = APCOSApiConstans.INF_CATEGORY_WEB)
    @PostMapping("/saveAkInfo")
    public ResultEntity saveAkInfo(SmsAkInfo smsAkInfo){
        return smsAkInfoService.saveOrUpdate(smsAkInfo);
    }

}
